from redis.asyncio import from_url
from conf.config import redis_config

redis_client = from_url(
    redis_config.REDIS_URL,
    max_connections=redis_config.MAX_CONNECTIONS,
    encoding="utf8",
    decode_responses=True
)


async def init_redis():
    """检测 Redis 连接"""
    await redis_client.ping()
